home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13983 < prev    next >
Encoding:
Text File  |  1996-08-05  |  758 b   |  25 lines

  1. Newsgroups: comp.lang.c
  2. Path: hobbit.ireq.hydro.qc.ca!news
  3. From: Ryszard Pater <pater@ireq.ca>
  4. Subject: Square of a floating point number.
  5. X-Nntp-Posting-Host: paspebiac.ireq.ca
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <Dpo0Mn.DEo@ireq.hydro.qc.ca>
  8. Sender: news@ireq.hydro.qc.ca (Netnews Admin)
  9. Content-Transfer-Encoding: 7bit
  10. Organization: IREQ
  11. Mime-Version: 1.0
  12. Date: Wed, 10 Apr 1996 21:20:47 GMT
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. How could I optimize for a speed the function to compute the square 
  16. of a floating point number?  I defined a function as follows:
  17. inline float sqr(float a) {return a*a;}  
  18. or macro version
  19. #define sqr(a) ((a)*(a)).
  20. If You have a better solution give me a feed back, please. 
  21.  
  22. Ryszard
  23. pater@ireq.ca
  24.  
  25.